home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 401-425 / disk_415 / uedit / config!m < prev    next >
Text File  |  1992-05-06  |  60KB  |  2,144 lines

  1. ======= MISCELLANEOUS CMDS =======
  2.  
  3. Set max number of files can load for normal editing (1-100, usually 20)
  4. <altCtl-f1:
  5.     putMsg("Input max # documents allowed (1-100)")
  6.     if (inputNum(n54)) setMaxFiles(n54) >
  7.  
  8. Set start of hilite region
  9. <shft-buttonDown:
  10.     equateLoc(curFile,sHilite,mouseLoc) refreshDisplay >
  11.  
  12. Set end of hilite region
  13. <alt-buttonDown:
  14.     equateLoc(curFile,eHilite,mouseLoc) refreshDisplay >
  15.  
  16. Mark region clicked with mouse
  17. <virtual-buttonDown:
  18.     equateLoc(curFile,atCursor,mouseLoc)
  19.     equateLoc(curFile,eInvert,atCursor)
  20.     equateLoc(curFile,sInvert,atCursor)
  21.     if (eqNum(curFile,38)) equateLoc(buf38,eHilite,sHilite)
  22.     while (mouseDown) inputKey(n54)
  23.  
  24.     if (is(curFile,eFile) | is(curFile,whiteSpace)) returnFalse
  25.  
  26.     while (!is(curFile,whiteSpace) & !is(curFile,sFile))
  27.         moveCursor(curFile,sChar)                      .. find start non-white
  28.     if (is(curFile,whiteSpace)) moveCursor(curFile,eChar)
  29.     equateLoc(curFile,sInvert,atCursor)          .. sinvert = start non-white
  30.  
  31.     while (!is(curFile,whiteSpace) & !is(curFile,eFile))
  32.         moveCursor(curFile,eChar)                        .. find end non-white
  33.     equateLoc(curFile,eInvert,atCursor)            .. einvert = end non-white
  34.     if (eqNum(curFile,38)) {                        .. in directory buffer 38
  35.         equateLoc(curFile,sHilite,sInvert)
  36.         equateLoc(curFile,eHilite,eInvert)
  37.         equateLoc(curFile,sInvert,eInvert)
  38.         moveCursor(curFile,sHilite)
  39.     }
  40.     refreshDisplay
  41. >
  42.  
  43. Load File or select Directory that is CTRL-clicked.
  44. <ctl-buttonDown:
  45.     equateNum(n7,curFile)
  46.     if (!runKey(virtual-buttonDown)) { runKey(virtual-buttonUp) return }
  47.     if (!eqNum(curFile,38)) {
  48.         if (geLoc(curFile,sInvert,eInvert)) return                  .. no rgn
  49.         moveCursor(curFile,sChar)
  50.         if (!is(curFile,"/") & !is(curFile,":")) {
  51.             freeBuf(buf54)
  52.             moveCursor(curFile,sInvert)
  53.             while (!eqLoc(curFile,atCursor,eInvert)) {
  54.                 if (is(curFile,":")) goto label(99)
  55.                 moveCursor(curFile,eChar)
  56.             }
  57.             insertRgn(buf54,sFile,buf38,hilite)
  58. label(99)
  59.             insertRgn(buf54,eFile,curFile,invert)
  60.             loadFile(buf54)
  61.             return
  62.         }
  63.         moveCursor(curFile,eInvert)
  64.         freeBuf(buf53)
  65.         insertRgn(buf53,eFile,curFile,invert)
  66.         runKey(virtual-7)                                  .. add dir to buf38
  67.     }
  68.     runKey(virtual-9)                                          .. show dir msg
  69.     return
  70. >
  71.  
  72. Handle buf38 directory traffic
  73. <virtual-buttonUp:
  74.     runKey(virtual-8)                     .. load in dir defalts if not loaded
  75.     equateLoc(buf38,mouseLoc,atCursor)
  76.     equateNum(n8,0)
  77.     if (!eqNum(curFile,38) & !gotoSplit(buf38)) {
  78.         if (!splitWindow(buf38,7)) {
  79.             putMsg("Close a split window so can let you select Directory")
  80.             return
  81.         }
  82.         equateNum(n8,1)                           .. had to make split window
  83.     }
  84.     updateDisplay
  85. label(98)
  86.     equateLoc(buf38,mouseLoc,sFile)
  87.     putMsg(
  88.     "Ctrl-mouse=SelectDir.  F1=Edit.  F2=DirList.  F3=Save.  F4=ChgDir.  F5=CD.")
  89.  
  90.     while (mouseDown) inputKey(n54)
  91.     getKeyVal(macroNum,inputChar)
  92.     switch(macroNum) {
  93.         case(normal-buttonDown) {                    .. done bring down window
  94.             gotoSplit(buf[n7])
  95.             if (eqNum(n8,1)) splitWindow(buf38,0)       .. close it if made it
  96.             runKey(virtual-9)
  97.             return
  98.         }
  99.         case(normal-f1) {                                        .. edit buf38
  100.             putMsg("Press left-Amiga-0 to elim split window.")
  101.             return
  102.         }
  103.         case(ctl-buttonDown) {
  104.             runkey(virtual-buttonDown)
  105.             refreshDisplay
  106.             runKey(virtual-9)
  107.             delay(3)
  108.         }
  109.         case(normal-f2) {                                      .. get dir list
  110.             gotoSplit(buf[n7])
  111.             if (eqNum(n8,1)) splitWindow(buf38,0)       .. close it if made it
  112.             if (newFile) {
  113.                 setFileName(curFile,"DirList")
  114.                 clearRgn(curFile,all)
  115.                 insertRgn(curFile,atCursor,buf38,hilite)
  116.                 insertChar(curFile,eLine)
  117.                 equateLoc(curFile,sPage,sFile)
  118.                 updateDisplay
  119.                 freeBuf(buf54)
  120.                 insertRgn(buf54,eFile,"dir ",all)
  121.                 insertRgn(buf54,eFile,buf38,hilite)
  122.                 execute(curFile,buf54)
  123.  
  124.                                                           .. massage dir list
  125.                 getSearch(buf49)
  126.                 setSearch(" (dir)")
  127.                 moveCursor(curFile,sFile)
  128.                 while (search(curFile,locA,locB,1)) {
  129.                     clearRgn(curFile,loc)
  130.                     insertChar(curFile,"/")
  131.                     moveCursor(curFile,sLine)
  132.                     moveCursor(curFile,eWord)
  133.                     moveCursor(curFile,sWord)
  134.                     insertRgn(curFile,atCursor,buf38,hilite)
  135.                 }
  136.                 setSearch(buf49)                     .. restore search string
  137.                 moveCursor(curFile,sFile)
  138.                 flipFlag(curFile,changed)
  139.                 putMsg("Ctl-click dirnames to add, filenames to load.")
  140.                 return
  141.             } else putMsg("Can't open file buf for dir list")
  142.         }
  143.         case(normal-f3) { saveFile(buf38) }
  144.         case(normal-f4) {                                        .. change dir
  145.             if (gtLoc(buf38,eHilite,sHilite)) {
  146.                 freeBuf(buf54)
  147.                 insertRgn(buf54,eFile,buf38,hilite)
  148.                 changeDir(buf54)
  149.                 goto label(0)
  150.             }
  151.         }
  152.         case(normal-f5) {                                            .. get CD
  153. label(0)    freeBuf(buf53)
  154.             execute(buf53,"CD")
  155.             freeBuf(buf54)
  156.             insertRgn(buf54,eFile,"CD = ",all)
  157.             insertRgn(buf54,eFile,buf53,line)
  158.             putMsg(buf54)
  159.             delay(5)
  160.         }
  161.     }
  162.     goto label(98)
  163. >
  164.  
  165. Click or drag mouse, put word/phrase into index in buf41.  (Ctl-w to see.)
  166. <shftAlt-buttonDown:
  167.     equateLoc(curFile,atCursor,mouseLoc)
  168.     moveCursor(curFile,eWord)
  169.     equateLoc(curFile,eInvert,atCursor)
  170.     moveCursor(curFile,sWord)
  171.     equateLoc(curFile,sInvert,atCursor)
  172.     refreshDisplay >
  173.  
  174. Click or drag mouse, put word/phrase into index in buf41.  (Ctl-w to see.)
  175. <shftAlt-buttonUp:
  176.     equateLoc(curFile,atCursor,mouseLoc)
  177.     moveCursor(curFile,eWord)
  178.     equateLoc(curFile,eInvert,atCursor)
  179.     if (geLoc(curFile,sInvert,eInvert)) returnFalse
  180.     moveCursor(curFile,sInvert)
  181.     if (is(curFile,upperCase)) equateNum(n0,1)
  182.     else equateNum(n0,0)
  183.     toLower(curFile)
  184.     copyChar(curFile,n54)
  185.     if (eqNum(n0,1)) toUpper(curFile)
  186.     if (isEmpty(buf41)) insertChar(buf41,eLine)
  187.     moveCursor(buf41,sFile)
  188.     equateLoc(buf41,sPage,atCursor)
  189. label(1)
  190.     if (is(buf41,upperCase)) equateNum(n0,1)
  191.     else equateNum(n0,0)
  192.     toLower(buf41)
  193.     copyChar(buf41,n53)
  194.     if (eqNum(n0,1)) toUpper(buf41)
  195.     if (gtNum(n54,n53)) {
  196.         moveCursor(buf41,downLine)
  197.         if (!is(buf41,eFile)) goto label(1)
  198.     }
  199.     insertRgn(buf41,atCursor,curFile,invert)
  200.     insertChar(buf41,eLine)
  201. >
  202.  
  203. Set start of invert region
  204. <shftCtl-buttonDown:
  205.     equateLoc(curFile,sInvert,mouseLoc) refreshDisplay >
  206.  
  207. Set end of invert region
  208. <altCtl-buttonDown:
  209.     equateLoc(curFile,eInvert,mouseLoc) refreshDisplay >
  210.  
  211. Drag mouse and create hilite region
  212. <shftAltCtl-buttonDown:
  213.     equateLoc(curFile,locA,mouseLoc)
  214.     while (trackMouse) nothing
  215.     if (gtLoc(curFile,locA,mouseLoc)) {
  216.         equateLoc(curFile,sHilite,mouseLoc)
  217.         equateLoc(curFile,eHilite,locA)
  218.     } else {
  219.         equateLoc(curFile,eHilite,mouseLoc)
  220.         equateLoc(curFile,sHilite,locA)
  221.     }
  222.     refreshDisplay >
  223.  
  224. Adjust active split window size with mouse
  225. <lAmiga-=:
  226.     getSplitLines(n53,n52)                           .. see if is upper split
  227.     if (eqNum(n53,0)) {
  228.         putMsg("Adjust lower splits, not top one")
  229.         returnFalse                                 .. don't size main window
  230.     }
  231.     putMsg("Press button, move mouse to set split window size")
  232.     getkey(N54)
  233.     if (!mouseDown) return
  234.     trackMouse
  235.     mouseXY(n4,n5)
  236.     equateNum(n54,curFile)
  237. label(0)
  238.     if (inputWaiting) { putMsg(" ") return }
  239.     trackMouse
  240.     mouseXY(n2,n3)
  241.     getSplitLines(n53,n52)                                .. get start & stop
  242.     sub(n52,n52,n53)
  243.     if (gtNum(n5,n3)) {
  244.         if (gtNum(n53,3)) incNum(n52)
  245.         else goto label(0)
  246.     }
  247.     else if (gtNum(n3,n5)) decNum(n52)
  248.     else goto label(0)
  249.     if (!eqNum(n5,n3)) {
  250.         splitWindow(curFile,0)
  251.         if (gtNum(2,n52)) equateNum(n52,2)
  252.         splitWindow(buf[n54],n52)
  253.         updateDisplay
  254.         equateNum(n5,n3)
  255.     }
  256.     goto label(0)
  257.     >
  258.  
  259. Scroll up 1 line
  260. <normal-upArrow:
  261.     if (!thisKey) vScroll(-1)
  262.     else while (nothing) {
  263.         if (!vScroll(-1) | !inputWaiting) return
  264.         while (inputKey(n54)) nothing
  265.         vScroll(-3)
  266.         updateDisplay
  267.     } >
  268.  
  269. Scroll down 1 line
  270. <normal-downArrow:
  271.     if (!thisKey) vScroll(1)
  272.     else while (nothing) {
  273.         if (!vScroll(1) | !inputWaiting) return
  274.         while (inputKey(n54)) nothing
  275.         vScroll(3)
  276.         updateDisplay
  277.     } >
  278.  
  279. Scroll right 1 char
  280. <normal-leftArrow: hScroll(1) >
  281.  
  282. Scroll left 1 char
  283. <normal-rightArrow: hScroll(-1) >
  284.  
  285. Scroll up 11 lines
  286. <shft-upArrow: vScroll(-11) >
  287.  
  288. Scroll down 11 lines
  289. <shft-downArrow: vScroll(11) >
  290.  
  291. Scroll right 10 chars
  292. <shft-leftArrow: hScroll(10) >
  293.  
  294. Scroll left 10 chars
  295. <shft-rightArrow: hScroll(-10) >
  296.  
  297. Scroll to start of page
  298. <alt-upArrow: vScroll(sPage) >
  299.  
  300. Scroll to bottom of page
  301. <alt-downArrow: vScroll(ePage) >
  302.  
  303. Scroll right 20 chars
  304. <alt-leftArrow: hScroll(20) >
  305.  
  306. Scroll left 20 chars
  307. <alt-rightArrow: hScroll(-20) >
  308.  
  309. Scroll to start of file
  310. <ctl-upArrow: vScroll(sFile) >
  311.  
  312. Scroll to end of file
  313. <ctl-downArrow: vScroll(eFile) >
  314.  
  315. Scroll to end of line
  316. <ctl-leftArrow:
  317.     getLocal(curFile,n54,lineLength)
  318.     hScroll(n54) >
  319.  
  320. Scroll to start of line
  321. <ctl-rightArrow: while (hScroll(-1)) nothing >
  322.  
  323. Load and show help file - press again to release help
  324. <normal-help:
  325.     if (!isEmpty(buf42)) {
  326.                    equateNum(n54,curFile)
  327.                    if (eqNum(n54,42)) freeBuf(buf42)
  328.                    else editBuf(buf42)
  329.     } else {
  330.         insertFile(buf42,sFile,"Help!")
  331.         if (isEmpty(buf42)) {
  332.             freeBuf(buf42)
  333.             insertFile(buf42,sFile,"S:Help!")
  334.         }
  335.         if (!isEmpty(buf42)) {
  336.             editBuf(buf42)
  337.             flipFlag(buf42,readOnly)
  338.         } else putMsg("Can't find S:Help! file.")
  339.     } >
  340.  
  341. Show current values of line-length, lines/page, tab-table #, colors, etc
  342. <shft-help:
  343.     putMsg(" ")
  344.     equateLoc(curfile,locA,atCursor)
  345.     moveCursor(curfile,sFile)
  346.     moveCursor(curfile,eLine)
  347.     copyChar(curfile,n52)
  348.     moveCursor(curfile,locA)
  349.     updateDisplay
  350.     equateNum(n51,curFile)
  351.     text(" ",0,0,0,-2)
  352.     text("Serial number:                       Left margin     :",2,0,0,0)
  353.     text("Buffer       :                       Top margin      :",3,0,0,0)
  354.     text("Changed      :                       Bottom margin   :",4,0,0,0)
  355.     text("Size         :                       Tab table       :",5,0,0,0)
  356.     text("Max files    :                       Printer select  :",6,0,0,0)
  357.     text("Split size   :                       (unused)        :",7,0,0,0)
  358.     text("Idle timer   :                       Print tabs      :",8,0,0,0)
  359.     text("Colors       :                       Smart tabs      :",9,0,0,0)
  360.     text("Scroll type  :                       Search wildcard :",10,0,0,0)
  361.     text("Hide display :                       \"\"    multiWild :",11,0,0,0)
  362.     text("End-of-line  :                       \"\"       allBut :",12,0,0,0)
  363.     text("PM terminator:                       \"\"     eitherOr :",13,0,0,0)
  364.     text("Line length  :                       \"\"  singleWhite :",14,0,0,0)
  365.     text("Lines/page   :                       \"\"   multiWhite :",15,0,0,0)
  366.     text("Values for this buffer",1,0,5,0)
  367.     getSerialNum(n54)
  368.     text(n54,2,16,1,0)
  369.     getLocal(curFile,n54,leftMargin)
  370.     text(n54,2,56,1,0)
  371.     text(n51,3,16,1,0)                                        ..buffer number
  372.     getLocal(curFile,n54,topMargin)
  373.     text(n54,3,56,1,0)
  374.     if (getFlag(curFile,changed)) text("YES",4,16,2,0)
  375.     else text("no",4,16,1,0)
  376.     getLocal(curFile,n54,bottomMargin)
  377.     text(n54,4,56,1,0)
  378.     getLocal(curFile,n54,tabTable)    .. SEE BELOW - computing file size last
  379.     text(n54,5,56,1,0)
  380.     getMaxFiles(n54)
  381.     text(n54,6,16,1,0)
  382.     text(prefPrint,6,56,1,0)
  383.     text(splitSize,7,16,1,0)
  384.     text(0,7,56,1,0)
  385.     text(idleTime,8,16,1,0)
  386.     text(printTabs,8,56,1,0)
  387.     freeBuf(buf53)
  388.     getWBColors(n0,n1,n2,n3)
  389.     toWord(buf53,n0)
  390.     toWord(buf53,n1)
  391.     toWord(buf53,n2)
  392.     toWord(buf53,n3)
  393.     text(buf53,9,16,1,0)
  394.     text(smartTabs,9,56,1,0)
  395.     text(scrollType,10,16,1,0)
  396.     freeBuf(buf53)
  397.     insertChar(buf53,wildCard)
  398.     text(buf53,10,56,1,0)
  399.     if (getFlag(curFile,hideDisplay)) text("YES",11,16,2,0)
  400.     else text("no",11,16,1,0)
  401.     freeBuf(buf53)
  402.     insertChar(buf53,multiWild)
  403.     text(buf53,11,56,1,0)
  404.     text(n52,12,16,1,0)                               .. eol, copied it above
  405.     freeBuf(buf53)
  406.     insertChar(buf53,allBut)
  407.     text(buf53,12,56,1,0)
  408.     text(pmESC,13,16,1,0)
  409.     freeBuf(buf53)
  410.     insertChar(buf53,eitherOr)
  411.     text(buf53,13,56,1,0)
  412.     getLocal(curFile,n54,lineLength)
  413.     text(n54,14,16,1,0)
  414.     text(singleWhite,14,56,1,0)
  415.     getLocal(curFile,n54,pageLines)
  416.     text(n54,15,16,1,0)
  417.     text(multiWhite,15,56,1,0)
  418.     putMsg("Any key to continue")
  419.     fileSize(curFile,n54)
  420.     text(n54,5,16,1,0)
  421.     getKey(n54)
  422.     putMsg(" ")
  423.     refreshDisplay >
  424.  
  425. Rotate 4 Workbench colors in Uedit
  426. <alt-help: toggle(color) >
  427.  
  428. Start this Key-Help mode - press Amiga-ESC to leave this Key-Help mode
  429. <ctl-help: flipFlag(curFile,teachKeys) >
  430.  
  431. Refresh window (or screen in interlace), including title bar
  432. <shftCtl-help: refreshDisplay >
  433.  
  434. Rebuild the menus by running the startup command
  435. <shftAltCtl-Help: runKey(startup) >
  436.  
  437. Close file.  If changed, ask "Save changes?"  If no files, ask "Really quit?"
  438. <normal-closeBox:
  439.     if (getFlag(curfile,changed) &
  440.         askYesNo("Save changes?") &
  441.             !saveFile(curFile)) return
  442.     freeBuf(curFile)
  443.     if (isEmpty(curFile)) {
  444.         equateNum(n1,0)
  445.         getMaxFiles(n2)
  446.         decNum(n2)
  447.         do (n0,0,n2) if (!isEmpty(buf[n0])) equatenum(n1,1)
  448.         if (eqNum(n1,0) & askYesNo("Really quit?")) quit(0)
  449.     } >
  450.  
  451. Switch to next document
  452. <normal-gadget1: toggle(curFile) >
  453.  
  454. Switch to previous document
  455. <normal-gadget2: runKey(shft-f1) >
  456.  
  457. Scroll display down
  458. <normal-gadget3: while (mouseDown) { vScroll(downLine) updateDisplay } >
  459.  
  460. Scroll display up
  461. <normal-gadget4: while (mouseDown) { vScroll(upLine)   updateDisplay } >
  462.  
  463. Switch to next file
  464. <normal-f1: toggle(curFile) >
  465.  
  466. Switch to previous file
  467. <shft-f1:
  468.     getMaxFiles(n53)
  469.     if (geNum(1,n53)) { editBuf(buf0) returnFalse }
  470.     decNum(n53)
  471.     equateNum(n54,curFile)
  472.     while (nothing) {
  473.         if (gtNum(n54,n53)) equateNum(n54,n53)
  474.         decNum(n54)
  475.         if (gtNum(0,n54)) equateNum(n54,n53)
  476.         if (getFileName(buf54,buf[n54])) {
  477.             editBuf(buf[n54])
  478.             returnTrue
  479.         }
  480.     } >
  481.  
  482. Load a file
  483. <alt-f1:
  484.     putMsg("Input new filename:")
  485.     freeBuf(buf43)
  486.     if (inputString(buf43)) loadFile(buf43) >
  487.  
  488. Open new "Noname" file
  489. <ctl-f1: newFile >
  490.  
  491. Insert file at cursor
  492. <shftAlt-f1:
  493.     putMsg("Input filename to insert:")
  494.     freeBuf(buf43)
  495.     if (inputString(buf43)) insertFile(curFile,atCursor,buf43) >
  496.  
  497. Restore current file to original
  498. <shftCtl-f1:
  499.     if (!askYesNo("Restore file to original?")) returnFalse
  500.     if (getFileName(buf43,curFile)) { freeBuf(curFile) loadFile(buf43) } >
  501.  
  502. Bring up file-requester
  503. <lAmiga-f1:
  504.     freeBuf(buf54)
  505.     insertRgn(buf54,eFile,buf38,hilite)
  506.     moveCursor(buf54,efile)
  507.     moveCursor(buf54,sChar)
  508.     if (!is(buf54,sfile) & is(buf54,"/")) clearChar(buf54)
  509.     if (fileRequest(buf54,"Select Directory and/or File")) {
  510.         freeBuf(buf53)                         .. if True, always has 2 lines
  511.         insertRgn(buf53,efile,buf54,all)
  512.         moveCursor(buf53,sfile)
  513.         if (!is(buf53,eline)) moveCursor(buf53,eLine)
  514.         clearChar(buf53)                                     .. erase the eol
  515.         loadFile(buf53)
  516.     }
  517.     if (isEmpty(buf54)) {
  518.         putMsg("No selection or no Arp")
  519.         returnFalse
  520.     }
  521.     moveCursor(buf54,sfile)    .. puts filename on line 2.  outputs "*" if no
  522.     if (!is(buf54,"*") & !is(buf54,eLine)) {
  523.         freeBuf(buf53)
  524.         insertRgn(buf53,efile,buf54,line)
  525.         runKey(virtual-7)      .. store dirname in buf38, if not already there
  526.     }
  527. >
  528.  
  529. Save file currently in window
  530. <normal-f2: saveFile(curFile) >
  531.  
  532. Save file under different name
  533. <shft-f2:
  534.     putMsg("Save file as:")
  535.     freeBuf(buf43)
  536.     if (inputString(buf43) & setFileName(curFile,buf43)) saveFile(curFile) >
  537.  
  538. Save all changed files
  539. <alt-f2:
  540.     getMaxFiles(n53)
  541.     decNum(n53)
  542.     do(n54,0,n53) if (getFlag(buf[n54],changed)) saveFile(buf[n54]) >
  543.  
  544. Turn on/off saving changes during idle periods
  545. <ctl-f2: flipFlag(curFile,userLocalA)>
  546.  
  547. Abort the current file save
  548. <shftAlt-f2: abortSave >
  549.  
  550. Save hilite as...
  551. <shftCtl-f2:
  552.     freeBuf(buf43)
  553.     insertRgn(buf43,atCursor,buf38,hilite)
  554.     putMsg("Save hilite as:")
  555.     if (!inputString(buf43)) return
  556.     freeBuf(buf54)
  557.     insertRgn(buf54,efile,curFile,hilite)
  558.     setFileName(buf54,buf43)
  559.     saveFile(buf54)
  560.     freeBuf(buf54) >
  561.  
  562. Close current file.  If changed, ask "Save changes?"
  563. <normal-f3:
  564.     if (!isEmpty(curFile)
  565.         & getFlag(curFile,changed)
  566.         & askYesNo("Save changes before closing?")
  567.         & !saveFile(curFile)) returnFalse
  568.     freeBuf(curFile) >
  569.  
  570. Save file, if changed, then close it
  571. <shft-f3:
  572.     if (getFlag(curFile,changed) & !saveFile(curFile)) returnFalse
  573.     freeBuf(curFile) >
  574.  
  575. Free all non-file buffers.  Erases search buffer, directory name, etc
  576. <alt-f3:
  577.     getMaxFiles(n52)
  578.     do(n54,n52,54) freeBuf(buf[n54]) >
  579.  
  580. Ask "Save changes?", if any changes, then ask "Really quit?"
  581. <normal-f4:
  582.     if (!askYesNo("Really quit?")) returnFalse
  583.     equateNum(n53,0)
  584.     getMaxFiles(n52)
  585.     decNum(n52)
  586.     do(n54,0,n52) if (getFlag(buf[n54],changed)) equateNum(n53,1)
  587.     if (eqNum(n53,1) & askYesNo("Save changes?") & !runKey(shft-f4))
  588.         returnFALSE
  589.     quit(0) >
  590.  
  591. Save all changed files automatically, then quit
  592. <shft-f4:
  593.     getMaxFiles(n52)
  594.     decNum(n52)
  595.     do (n54,0,n52)
  596.     if (getFlag(buf[n54],changed) & !saveFile(buf[n54])) returnFalse
  597.     quit(0) >
  598.  
  599. Swap next 2 commands. (Mouse buttons, menu selections, gadgets, keys.)
  600. <normal-f5:
  601.     putMsg("Next 2 function keys will be swapped!")
  602.     if (getKey(n53) & getKey(n54) & swapKey(n53,n54))
  603.             { putMsg("Keys were swapped.") return }
  604.     putMsg(" ") >
  605.  
  606. Toggle overstrike typing mode
  607. <shft-f5: flipFlag(curFile,overstrike) >
  608.  
  609. Toggle autoindent typing mode
  610. <alt-f5: flipFlag(curFile,autoIndent) >
  611.  
  612. Toggle wordwrap typing mode
  613. <ctl-f5: flipFlag(curFile,wordWrap) >
  614.  
  615. Toggle "changed" status of current buffer
  616. <lAmiga-f5: flipFlag(curFile,changed) >
  617.  
  618. Convert file to read-only status
  619. <shftAlt-f5: flipFlag(curFile,readOnly) >
  620.  
  621. Toggle speak-messages status
  622. <shftCtl-f5: flipFlag(curFile,speakMsgs) >
  623.  
  624. Toggle speak-alerts status
  625. <altCtl-f5: flipFlag(curFile,speakAlerts) >
  626.  
  627. Toggle auto-backup mode
  628. <shftAltCtl-f5: flipFlag(curFile,autoBackup) >
  629.  
  630. Save Uedit state
  631. <rAmiga-f5: saveState("uestate")>
  632.  
  633. Load Uedit state
  634. <rAmiga-f6: loadState("uestate")>
  635.  
  636. Select buffer 44 to use for scratch editing or writing commands
  637. <shft-f6:
  638.     editBuf(buf44)
  639.     putMsg("Type in command, <anykey: etc>, and press F6 to compile:") >
  640.  
  641. Save UE config to disk.  Default is Data! or last name you gave
  642. <alt-f6:
  643.     if (askYesNo("Save data?")) {
  644.         putMsg("Input data filename or pmESC:")
  645.         freeBuf(buf54)
  646.         inputString(buf54)
  647.         saveConfig(buf54)
  648.     } >
  649.  
  650. Restore UE config from disk.  Default is Data! or last name you gave
  651. <ctl-f6:
  652.     if (askYesNo("Load data?")) {
  653.         putMsg("Input data filename or pmESC:")
  654.         freeBuf(buf54)
  655.         inputString(buf54)
  656.         loadConfig(buf54)
  657.     } >
  658.  
  659. Compile configuration default values at the top of Config! file
  660. <altCtl-f6:
  661.     moveCursor(curFile,sFile)
  662.     if (!compileDefaults) beepDisplay>
  663.  
  664. Input the number of a buffer to edit
  665. <shftAlt-f6:
  666.     putMsg("Input number of buffer to edit:")
  667.     if (inputNum(n54)) { editBuf(buf[n54]) vScroll(sFile) } >
  668.  
  669. Examine all buffers that aren't empty
  670. <shftCtl-f6:
  671.     getMaxFiles(n52)
  672.     do (n54,n52,99) if (!isEmpty(buf[n54])) {
  673.         editBuf(buf[n54])
  674.         vScroll(sFile)
  675.         updateDisplay
  676.         putMsg("F1=continue, F2=edit this one, F3=stop:")
  677.         getKey(n53)
  678.         if (eqNum(n53,normal-f2)) { putMsg(" ") return }
  679.         if (eqNum(n53,normal-f3)) goto label(1)
  680.     }
  681.     label(1)
  682.     toggle(curFile)
  683.     putMsg(" ") >
  684.  
  685. Kill next command, including mouse button, menu selection, gadget, key
  686. <shftAltCtl-f6:
  687.     putMsg("Next command-key will be deleted!")
  688.     if (getKey(n54) & killKey(n54))
  689.             { putMsg("Key command was deleted.") return }
  690.     putMsg(" ") >
  691.  
  692.  
  693. Find out if keys have got commands attached
  694. <lAmiga-f6:
  695.     putMsg("Press any key")
  696.     while (getKey(n54)) {
  697.         if (inUse(n54)) putMsg("In use - Amiga-esc=abort")
  698.         else putMsg("Available - Amiga-esc=abort")
  699.     }>
  700.  
  701. Push current buffer onto buffer stack
  702. <lAmiga-w:  push(buf99,curFile) runKey(virtual-w)  >
  703.  
  704. Pop buffer stack
  705. <rAmiga-w:
  706.     equateNum(n51,99)           .. for buf stack 99
  707.     getStackSize(n51,n52,n53)
  708.     if (geNum(0,n51)) {
  709.         putMsg("Buffer stack is empty")
  710.         returnFalse
  711.     }
  712.     if (!askYesNo("Replace current buffer, deleting old?") & !newFile) {
  713.         putMsg("Can't open a file buffer")
  714.         returnFalse
  715.     }
  716.     pop(buf99,curFile)
  717.     runKey(virtual-w) >
  718.  
  719. Rotate buffer stack
  720. <shftAlt-w: rollStack(buf99,1) runKey(virtual-w) >
  721.  
  722. Show number of buffers in stack
  723. <virtual-w:
  724.     equateNum(n51,99)       .. for buffer stack 99
  725.     equateNum(n52,99)       .. and num stack 99
  726.     getStackSize(n51,n52,n53)
  727.     freeBuf(buf54)
  728.     insertRgn(buf54,atCursor,"Buffers on stack: ",all)
  729.     toWord(buf54,n51)
  730.     putMsg(buf54)  >
  731.  
  732. Input search text & search fwd.  (Either-Or="$", wildcards= "?" & "*".)
  733. <normal-f7: freeBuf(buf49) runKey(shft-f7) >
  734.  
  735. Modify existing search text and then search fwd
  736. <shft-f7:
  737.     putMsg("Input search string:")
  738.     inputString(buf49)
  739.     setSearch(buf49)
  740.     runKey(normal-f9) >
  741.  
  742. Input new search wild-card characters
  743. <alt-f7:
  744.     putMsg("Input single wild-card char:")
  745.     getChar(wildCard)
  746.     putMsg("Input multi wild-card char:")
  747.     getChar(multiWild)
  748.     putMsg("White on single wildcards: 0=no, 1=space/tab, 2=all white:")
  749.     getChar(n54)
  750.     if (geNum(n54,"0") & geNum("2",n54)) sub(singleWhite,n54,"0")
  751.     putMsg("White on multi wildcards: 0=no, 1=space/tab, 2=all white:")
  752.     getChar(n54)
  753.     if (geNum(n54,"0") & geNum("2",n54)) sub(multiWhite,n54,"0")
  754.     putMsg("Input all-but delimiter char:")
  755.     getChar(allBut)
  756.     putMsg(" ")>
  757.  
  758. Input new search either-or character
  759. <ctl-f7:
  760.     putMsg("Input new search either-or char:")
  761.     getChar(eitherOr)
  762.     putMsg(" ")>
  763.  
  764. Input replace text to use in search-replace
  765. <normal-f8: freeBuf(buf48) runKey(shft-f8) >
  766.  
  767. Modify existing replace text
  768. <shft-f8: putMsg("input replace string:") inputString(buf48) >
  769.  
  770. Search forward, mark matched region, put cursor at start of rgn
  771. <normal-f9:
  772.     if (eqLoc(curFile,atCursor,eInvert)) moveCursor(curFile,sChar)
  773.     if (search(curFile,sInvert,eInvert,1)) {
  774.       putMsg(" ")
  775.       return
  776.     }
  777.     runKey(virtual-f9) >                                 .. failed search msg
  778.  
  779. Search backward, mark matched region, put cursor at start of rgn
  780. <shft-f9:
  781.     if (search(curFile,sInvert,eInvert,-1)) { putMsg(" ") return }
  782.     runKey(virtual-f9) >                                 .. failed search msg
  783.  
  784. Failed search message used by fwd/bkwd search.
  785. <virtual-f9:
  786.     putMsg("Search failed.")
  787.     equateLoc(curFile,sInvert,eInvert)
  788.     refreshDisplay
  789.     returnFalse >
  790.  
  791. Replace matched region with replace text, then search forward
  792. <normal-f10:
  793.     if (eqLoc(curFile,sInvert,eInvert)) returnFalse
  794.     clearRgn(curFile,invert)
  795.     insertRgn(curFile,sInvert,buf48,all)
  796.     runKey(normal-f9) >
  797.  
  798. Replace matched region with replace text, then search backward
  799. <shft-f10:
  800.     if (eqLoc(curFile,sInvert,eInvert)) returnFalse
  801.     clearRgn(curFile,invert)
  802.     insertRgn(curFile,sInvert,buf48,all)
  803.     runKey(shft-f9) >
  804.  
  805. Replace and continue forward search-replace until search fails
  806. <alt-f10: while(runKey(normal-f10)) nothing >
  807.  
  808. Open a space under cursor for typing
  809. <shft-del:
  810.     insertChar(curFile," ") moveCursor(curFile,sChar)
  811.     if (is(curFile,sLine)) refreshDisplay>
  812.  
  813. Open line for typing below cursor line
  814. <alt-del:
  815.     if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  816.     insertChar(curFile,eLine)>
  817.  
  818. Delete line above cursor line
  819. <ctl-del:
  820.     equateLoc(curFile,mouseLoc,atCursor)
  821.     if (!is(curFile,sLine)) moveCursor(curFile,sLine)
  822.     if (!is(curFile,sFile)) {
  823.         moveCursor(curFile,upLine)
  824.         runKey(virtual-x)                                   .. this runs ctl-d
  825.         moveCursor(curFile,mouseLoc)
  826.     }>
  827.  
  828. Open a space for typing in front of current word
  829. <shft-bs:
  830.     if (!is(curFile,sWord)) moveCursor(curFile,sWord)
  831.     runKey(shft-del)>
  832.  
  833. Open line for typing above the current line
  834. <alt-bs:
  835.     if (!is(curFile,sLine)) moveCursor(curFile,sLine)
  836.     insertChar(curFile,eLine)  moveCursor(curFile,sChar)>
  837.  
  838. Delete line below cursor line
  839. <ctl-bs:
  840.     equateLoc(curFile,mouseLoc,atCursor)
  841.     if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  842.     if (!is(curFile,eFile)) {
  843.         moveCursor(curFile,downLine)
  844.         runKey(virtual-x)                                   .. this runs ctl-d
  845.         moveCursor(curFile,mouseLoc)
  846.     }>
  847.  
  848.                             *** Keypad Keys ***
  849. Find cursor and center it in window
  850. <normal-kp5: vScroll(atCursor) >
  851.  
  852. Delete word left, storing it in Undo buffer
  853. <normal-kp7:
  854.     if (!eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  855.     equateLoc(curFile,locB,atCursor)
  856.     moveCursor(curFile,sWord)
  857.     equateLoc(curFile,locA,atCursor)
  858.     insertRgn(buf45,sFile,curFile,loc)
  859.     equateLoc(buf45,sPage,sFile)
  860.     clearRgn(curFile,loc) >
  861.  
  862. Delete word right, storing it in Undo buffer
  863. <normal-kp9:
  864.     if (!eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  865.     equateLoc(curFile,locA,atCursor)
  866.     moveCursor(curFile,eWord)
  867.     equateLoc(curFile,locB,atCursor)
  868.     insertRgn(buf45,eFile,curFile,loc)
  869.     equateLoc(buf45,sPage,sFile)
  870.     clearRgn(curFile,loc) >
  871.  
  872. Move cursor up 1 line
  873. <normal-kp8: moveCursor(curFile,upLine) >
  874.  
  875. Move cursor down 1 line
  876. <normal-kp2: moveCursor(curFile,downLine) >
  877.  
  878. Move cursor to start of word
  879. <normal-kp4: moveCursor(curFile,sWord) >
  880.  
  881. Move cursor to end of word
  882. <normal-kp6: moveCursor(curFile,eWord) >
  883.  
  884. Set start of hilite region at cursor
  885. <normal-kp1: equateLoc(curFile,sHilite,atCursor) refreshDisplay >
  886.  
  887. Set end of hilite region at cursor
  888. <normal-kp3: equateLoc(curFile,eHilite,atCursor) refreshDisplay >
  889.  
  890. UNDO scratch deletes, inserting scratch delete buffer at cursor
  891. <normal-kp0: insertRgn(curFile,atCursor,buf45,all) >
  892.  
  893. Copy hilite region into buffer
  894. <normal-kpDot:
  895.     if (getFlag(curFile,columnar)) { runKey(shftCtl-3) return }
  896.     if (gtLoc(curFile,eHilite,sHilite)) {
  897.         freeBuf(buf47)
  898.         insertRgn(buf47,sFile,curFile,hilite)
  899.         equateLoc(buf47,sPage,sFile)
  900.     } else returnFalse >
  901.  
  902. Copy hilite region into buffer, then delete hilite region
  903. <normal-kpMinus:
  904.     if (getFlag(curFile,columnar)) { runKey(shftCtl-1) return }
  905.     if (runKey(normal-kpDot)) clearRgn(curFile,hilite)
  906.     vscroll(atcursor) >
  907.  
  908. Insert copied hilite at cursor
  909. <normal-kpEnter:
  910.     if (getFlag(curFile,columnar)) { runKey(shftCtl-4) return }
  911.     if (is(curFile,sFile)) {
  912.         equateLoc(curFile,sHilite,atCursor)
  913.         equateLoc(curFile,eHilite,sHilite)
  914.     } else {
  915.         equateLoc(curFile,sHilite,atCursor)
  916.         decLoc(curFile,sHilite)
  917.         equateLoc(curFile,eHilite,atCursor)
  918.     }
  919.     insertRgn(curFile,atCursor,buf47,all)
  920.     if (eqLoc(curFile,atCursor,sHilite)) equateLoc(curFile,sHilite,sFile)
  921.     else incLoc(curFile,sHilite)
  922.     if (!onScreen(atCursor)) vScroll(atCursor) >
  923.  
  924. Find cursor and center it in window
  925. <shft-kp5: vScroll(atCursor) >
  926.  
  927. Delete char to left of cursor, storing it in Undo buffer
  928. <shft-kp7:
  929.     if (!eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  930.     equateLoc(curFile,locB,atCursor)
  931.     moveCursor(curFile,sChar)
  932.     equateLoc(curFile,locA,atCursor)
  933.     insertRgn(buf45,sFile,curFile,loc)
  934.     equateLoc(buf45,sPage,sFile)
  935.     clearRgn(curFile,loc) >
  936.  
  937. Delete char under cursor, storing it in Undo buffer
  938. <shft-kp9:
  939.     if (!eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  940.     equateLoc(curFile,locA,atCursor)
  941.     moveCursor(curFile,eChar)
  942.     equateLoc(curFile,locB,atCursor)
  943.     insertRgn(buf45,eFile,curFile,loc)
  944.     equateLoc(buf45,sPage,sFile)
  945.     clearRgn(curFile,loc) >
  946.  
  947. Move cursor up one line
  948. <shft-kp8: moveCursor(curFile,upLine) >
  949.  
  950. Move cursor down one line
  951. <shft-kp2: moveCursor(curFile,downLine) >
  952.  
  953. Move cursor left 1 char
  954. <shft-kp4: moveCursor(curFile,sChar) >
  955.  
  956. Move cursor right 1 char
  957. <shft-kp6: moveCursor(curFile,eChar) >
  958.  
  959. Set start of hilite region at cursor
  960. <shft-kp1: runKey(normal-kp1) >
  961.  
  962. Set end of hilite region at cursor
  963. <shft-kp3: runKey(normal-kp3) >
  964.  
  965. UNDO scratch deletes, inserting scratch delete buffer at cursor
  966. <shft-kp0: runKey(normal-kp0) >
  967.  
  968. Copy hilite region into buffer
  969. <shft-kpDot: runKey(normal-kpDot) >
  970.  
  971. Copy hilite region into buffer, then delete hilite region
  972. <shft-kpMinus: runKey(normal-kpMinus) >
  973.  
  974. Insert copied hilite region at cursor
  975. <shft-kpEnter: runKey(normal-kpEnter) >
  976.  
  977. Find cursor and center it in window
  978. <alt-kp5: vScroll(atCursor) >
  979.  
  980. Delete to start of line, storing it in Undo buffer
  981. <alt-kp7:
  982.     if (!eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  983.     if (is(curFile,sLine)) runKey(shft-kp7)
  984.     else {
  985.         equateLoc(curFile,locB,atCursor)
  986.         moveCursor(curFile,sLine)
  987.         equateLoc(curFile,locA,atCursor)
  988.         insertRgn(buf45,sFile,curFile,loc)
  989.         equateLoc(buf45,sPage,sFile)
  990.         clearRgn(curFile,loc)
  991.     } >
  992. Delete to end of line, storing it in Undo buffer
  993. <alt-kp9:
  994.     if (!eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  995.     if (is(curFile,eLine)) runKey(shft-kp9)
  996.     else {
  997.         equateLoc(curFile,locA,atCursor)
  998.         moveCursor(curFile,eLine)
  999.         equateLoc(curFile,locB,atCursor)
  1000.         insertRgn(buf45,eFile,curFile,loc)
  1001.         equateLoc(buf45,sPage,sFile)
  1002.         clearRgn(curFile,loc)
  1003.     } >
  1004.  
  1005. Move cursor to start of page
  1006. <alt-kp8: moveCursor(curFile,sPage) vScroll(atCursor)>
  1007.  
  1008. Move cursor to end of page
  1009. <alt-kp2: moveCursor(curFile,ePage) >
  1010.  
  1011. Move cursor to start of line
  1012. <alt-kp4: moveCursor(curFile,sLine) >
  1013.  
  1014. Move cursor to end of line
  1015. <alt-kp6: moveCursor(curFile,eLine) >
  1016.  
  1017. Set start of hilite region at cursor
  1018. <alt-kp1: runKey(normal-kp1) >
  1019.  
  1020. Set end of hilite region at cursor
  1021. <alt-kp3: runKey(normal-kp3) >
  1022.  
  1023. UNDO scratch deletes, inserting scratch delete buffer at cursor
  1024. <alt-kp0: runKey(normal-kp0) >
  1025.  
  1026. Copy hilite region into buffer
  1027. <alt-kpDot: runKey(normal-kpDot) >
  1028.  
  1029. Copy hilite region into buffer, then delete hilite region
  1030. <alt-kpMinus: runKey(normal-kpMinus) >
  1031.  
  1032. Insert copied hilite region at cursor
  1033. <alt-kpEnter: runKey(normal-kpEnter) >
  1034.  
  1035. Find cursor and center it in window
  1036. <ctl-kp5: vScroll(atCursor) >
  1037.  
  1038. Delete from cursor to start of page, storing it in Undo buffer
  1039. <ctl-kp7:
  1040.     if (!eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  1041.     equateLoc(curFile,locB,atCursor)
  1042.     moveCursor(curFile,sPage)
  1043.     equateLoc(curFile,locA,atCursor)
  1044.     insertRgn(buf45,sFile,curFile,loc)
  1045.     equateLoc(buf45,sPage,sFile)
  1046.     clearRgn(curFile,loc)
  1047.     vScroll(atCursor)
  1048.     updateDisplay >
  1049.  
  1050. Delete from cursor to end of page, storing it in Undo buffer
  1051. <ctl-kp9:
  1052.     if (!eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  1053.     equateLoc(curFile,locA,atCursor)
  1054.     moveCursor(curFile,ePage)
  1055.     equateLoc(curFile,locB,atCursor)
  1056.     insertRgn(buf45,eFile,curFile,loc)
  1057.     equateLoc(buf45,sPage,sFile)
  1058.     clearRgn(curFile,loc)
  1059.     updateDisplay >
  1060.  
  1061. Move cursor to start of form
  1062. <ctl-kp8: moveCursor(curFile,sForm) >
  1063.  
  1064. Move cursor to end of form
  1065. <ctl-kp2: moveCursor(curFile,eForm) >
  1066.  
  1067. Move cursor to start of line
  1068. <ctl-kp4: moveCursor(curFile,sLine) >
  1069.  
  1070. Move cursor to end of line
  1071. <ctl-kp6: moveCursor(curFile,eLine) >
  1072.  
  1073. Set start of invert region at cursor
  1074. <ctl-kp1: equateLoc(curFile,sInvert,atCursor) refreshDisplay >
  1075.  
  1076. Set end of invert region at cursor
  1077. <ctl-kp3: equateLoc(curFile,eInvert,atCursor) refreshDisplay >
  1078.  
  1079. UNDO scratch deletes, inserting scratch delete buffer at cursor
  1080. <ctl-kp0: runKey(normal-kp0) >
  1081.  
  1082. Give message telling turn OFF columnar if columnar is ON.
  1083. <virtual-kpDot:
  1084.     if (getFlag(curFile,columnar)) {
  1085.         alertuser("Turn OFF columnar display mode first. (See Columnar menu.)")
  1086.         abort
  1087.     } >
  1088.  
  1089. Copy invert region into buffer
  1090. <ctl-kpDot:
  1091.     runKey(virtual-kpDot)
  1092.     if (gtLoc(curFile,eInvert,sInvert)) {
  1093.         freeBuf(buf46)
  1094.         insertRgn(buf46,sFile,curFile,invert)
  1095.         equateLoc(buf46,sPage,sFile)
  1096.     } else returnFalse >
  1097.  
  1098. Copy invert region into buffer, then delete invert region
  1099. <ctl-kpMinus:
  1100.     runKey(virtual-kpDot)
  1101.     runKey(ctl-kpDot)
  1102.     clearRgn(curFile,invert) >
  1103.  
  1104. Insert copied invert region at cursor
  1105. <ctl-kpEnter:
  1106.     runKey(virtual-kpDot)
  1107.         if (is(curFile,sFile)) {
  1108.             equateLoc(curFile,sInvert,atCursor)
  1109.             equateLoc(curFile,eInvert,sInvert)
  1110.         } else {
  1111.             equateLoc(curFile,sInvert,atCursor)
  1112.             decLoc(curFile,sInvert)
  1113.             equateLoc(curFile,eInvert,atCursor)
  1114.         }
  1115.         insertRgn(curFile,atCursor,buf46,all)
  1116.         if (eqLoc(curFile,atCursor,sInvert)) equateLoc(curFile,sInvert,sFile)
  1117.         else incLoc(curFile,sInvert)
  1118.         if (!onScreen(atCursor)) vScroll(atCursor) >
  1119.  
  1120.                         *** miscellaneous keys ***
  1121.  
  1122. Set new line-length
  1123. <ctl-return:
  1124.     putMsg("Enter new line-length:")
  1125.     if (inputNum(n54)) {
  1126.         setLocal(curFile,lineLength,n54)
  1127.         equateNum(lineLength,n54)
  1128.     } >
  1129.  
  1130. Transparent tab forward
  1131. <shft-tab: moveCursor(curFile,eTab) >
  1132.  
  1133. Transparent tab backward
  1134. <alt-tab: moveCursor(curFile,sTab) >
  1135.  
  1136. Untab - delete white space back to previous tab column
  1137. <ctl-tab:
  1138.     equateLoc(curFile,locA,atCursor)
  1139.     moveCursor(curFile,sTab)
  1140.     while (is(curFile,space) | is(curFile,9)) {
  1141.         clearChar(curFile)
  1142.         if (eqLoc(curFile,atCursor,locA)) return
  1143.     }>
  1144.  
  1145. Switch to/from using spaces for tabs or using real tabs
  1146. <altCtl-tab: flipFlag(curFile,trueTabs)>
  1147.  
  1148. Show tab ruler above cursor line
  1149. <shftAlt-tab: seeRuler>
  1150.  
  1151. Set tab ruler using mouse or keys
  1152. <shftCtl-tab:
  1153.     putMsg(
  1154.     "Use mouse click/drag, Tab, Space, BS, Del (anykey=quit,Amiga-ESC=abort)")
  1155.     setRuler putMsg(" ") >
  1156.  
  1157. Convert tabs in document to spaces
  1158. <lAmiga-t: tabsToSpaces >
  1159.  
  1160. Convert spaces in document to TABs
  1161. <rAmiga-t: spacesToTabs >
  1162.  
  1163. Set TAB table number (0-4) to use for TAB spacing
  1164. <shftAltCtl-tab:
  1165.     putMsg("Enter new tab table # (0-4):")
  1166.     if (inputNum(n54) & geNum(n54,0) & geNum(4,n54)) {
  1167.         setLocal(curFile,tabTable,n54)
  1168.         equateNum(tabTable,n54)
  1169.     } >
  1170.  
  1171. Toggle "busies" setting - when turned on, it shows buffers being worked on
  1172. <ctl-b: flipFlag(curFile,busies) >
  1173.  
  1174. Trim spaces between the next two words after cursor
  1175. <alt-c:
  1176.     while (copyChar(curfile,n54)
  1177.         & !(eqNum(n54,32) | eqNum(n54,9) | is(curfile,efile)))
  1178.                 moveCursor(curFile,eChar)
  1179.     moveCursor(curFile,eChar)
  1180.     if (is(curfile,efile)) returnFalse
  1181.     while (copyChar(curfile,n54)
  1182.         & (eqNum(n54,32) | eqNum(n54,9)))
  1183.                 clearChar(curfile) >
  1184.  
  1185. Let next character typed be a CTRL-character, such as formfeed, etc
  1186. <ctl-c:
  1187.     putMsg("Input a control character:")
  1188.     getChar(n54)
  1189.     if (geNum(31,n54) | (geNum(n54,64) & geNum(127,n54))) {
  1190.         and(n54,n54,31)
  1191.         insertChar(curFile,n54)
  1192.     }
  1193.     putMsg(" ") >
  1194.  
  1195. Count number of times the next command is successfully executed
  1196. <shftAlt-c:
  1197.     equateNum(n90,0)
  1198.     putMsg("Input command to execute & count:")
  1199.     if (getKey(n91)) {
  1200.         while (runKey(n91)) incNum(n90)
  1201.         freeBuf(buf54)
  1202.         insertRgn(buf54,sFile,"Times executed = ",all)
  1203.         toWord(buf54,n90)
  1204.         putMsg(buf54)
  1205.     } >
  1206.  
  1207. Delay the amount of time (tenths of seconds) stored using shftAlt-d
  1208. <alt-d: delay(n46) >
  1209.  
  1210. Delete cursor line, storing it in Undo buffer.  (See keypad-0/7/9.)
  1211. <ctl-d: runKey(virtual-x)
  1212. >
  1213.  
  1214. Delete cursor line
  1215. <virtual-x:
  1216.     if (!eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  1217.     equateLoc(curFile,locB,atCursor)
  1218.     if (!is(curFile,sLine)) moveCursor(curFile,sLine)
  1219.     if (!eqLoc(curFile,locB,atCursor)) {
  1220.         equateLoc(curFile,locA,atCursor)
  1221.         insertRgn(buf45,sFile,curFile,loc)
  1222.         clearRgn(curFile,loc)
  1223.     } else equateLoc(curFile,locA,atCursor)
  1224.     if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  1225.     moveCursor(curFile,eChar)
  1226.     equateLoc(curFile,locB,atCursor)
  1227.     insertRgn(buf45,eFile,curFile,loc)
  1228.     equateLoc(buf45,sPage,sFile)
  1229.     clearRgn(curFile,loc) >
  1230.  
  1231. Set the delay variable to some value in tenths of seconds
  1232. <shftAlt-d:
  1233.     putMsg("Input # tenths of seconds (used in delays)")
  1234.     inputNum(n46) >
  1235.  
  1236. Change end-of-line character
  1237. <alt-e:
  1238.     putMsg("Input new end-of-line value (usually 10 or 13):")
  1239.     inputNum(n54)
  1240.     setEol(n54)
  1241.     refreshDisplay >
  1242.  
  1243. Change current document's end-of-line character
  1244. <ctl-e:
  1245.     putMsg("Input file's current end-of-line value (usually 10 or 13):")
  1246.     inputNum(n54)
  1247.     if (!gtNum(n54,0)) returnFalse
  1248.     putMsg("Input new end-of-line value (usually 10 or 13):")
  1249.     inputNum(n53)
  1250.     if (!gtNum(n53,0)) returnFalse
  1251.     setEol(n54)
  1252.     moveCursor(curFile,sFile)
  1253.     putMsg("Changing eol characters... Amiga-ESC=abort.")
  1254.     if (is(curFile,n54)) swapChar(curFile,n53)
  1255.     while (moveCursor(curFile,eLine))
  1256.         if (is(curFile,n54)) swapChar(curFile,n53)
  1257.     setEol(n53)
  1258.     vScroll(sFile)
  1259.     putMsg(" ")
  1260.     refreshDisplay >
  1261.  
  1262. Input the number of buffer to free
  1263. <alt-f:
  1264.     putMsg("Input buffer # to free:")
  1265.     if (inputNum(n54)) freeBuf(buf[n54]) >
  1266.  
  1267. Flip upper/lower case of char under cursor
  1268. <ctl-f:
  1269.     if (is(curFile,alpha)) {
  1270.         if (is(curFile,lowerCase)) toUpper(curFile)
  1271.         else toLower(curFile)
  1272.     }
  1273.     moveCursor(curFile,eChar) >
  1274.  
  1275. Toggle the mark-gadgets setting.  When "off", the gadget names don't show
  1276. <ctl-g: flipFlag(curFile,markGadgets) >
  1277.  
  1278. Input a new lines/page value
  1279. <alt-g:
  1280.     putMsg("Enter new lines/page setting:")
  1281.     inputNum(n54)
  1282.     if (gtNum(n54,0)) {
  1283.         setLocal(curFile,pageLines,n54)
  1284.         equateNum(pageLines,n54)
  1285.     } >
  1286.  
  1287. Uncolor the hilite region
  1288. <alt-h: equateLoc(curFile,sHilite,eHilite) refreshDisplay >
  1289.  
  1290. Erase hilite region.  No Copy is made!
  1291. <ctl-h: clearRgn(curFile,hilite) >
  1292.  
  1293. Uncolor the invert region
  1294. <alt-i: equateLoc(curFile,sInvert,eInvert) refreshDisplay >
  1295.  
  1296. Erase the invert region.  No Copy is made!
  1297. <ctl-i: clearRgn(curFile,invert) >
  1298.  
  1299. Scan index buffer, build an index.  (See shftAlt-buttonDown/buttonUp.)
  1300. <shftAlt-i:
  1301.     if (isEmpty(buf41)) returnFalse
  1302.     runKey(alt-g)            .. Could elim.  get lines-per-page setting to use
  1303.     freeBuf(buf54)
  1304.     putMsg("Working....")                    .. erase duplicate items in buf41
  1305. label(10)                                               .. get next index item
  1306.     moveCursor(buf41,sFile)
  1307.     while (is(buf41,whiteSpace)) clearChar(buf41)     .. clear any blank lines
  1308.     if (is(buf41,eFile)) goto label(11)            .. done finding duplicates
  1309.     equateLoc(buf41,sInvert,atCursor)                            .. mark start
  1310.     moveCursor(buf41,downLine)
  1311.     equateLoc(buf41,eInvert,atCursor)                              .. mark end
  1312.     freeBuf(buf49)
  1313.     insertRgn(buf49,eFile,buf41,invert)                 .. copy item to buf49
  1314.     clearRgn(buf41,invert)                                .. erase from buf41
  1315.     insertRgn(buf54,eFile,buf49,all)                       .. add it to buf54
  1316.     moveCursor(buf41,eFile)                           .. search bkwd for dups
  1317.     setSearch(buf49)
  1318.     while (search(buf41,sInvert,eInvert,-1)) clearRgn(buf41,invert).. del dup
  1319.     goto label(10)                  .. get next item, unless buf41 empty now.
  1320. label(11)
  1321.     freeBuf(buf41)                                           .. starting over
  1322.     insertRgn(buf41,eFile,buf54,all)            .. store no-dup list in buf41
  1323.     freeBuf(buf54)                                 .. erase old list in buf54
  1324. label(1)                            .. NOTE: should have used swapBuf instead
  1325.     moveCursor(buf41,sFile)
  1326.     while (is(buf41,whiteSpace)) clearChar(buf41)    .. clear lead white space
  1327.     if (is(buf41,eFile)) {                   .. buf41 empty, must be finished
  1328.         swapBuf(buf54,buf41)                            .. index was in buf54
  1329.         freeBuf(buf54)
  1330.         setFileName(buf41,"Index")
  1331.         equateLoc(buf41,sPage,sFile)
  1332.         equateLoc(buf41,atCursor,sFile)
  1333.         putMsg("Press ctl-w to see Index")                        .. finished
  1334.         return
  1335.     }
  1336.     freeBuf(buf49)
  1337.     insertRgn(buf49,sFile,buf41,line)         .. load search string with item.
  1338.     clearRgn(buf41,line)                                    .. erase the item
  1339.     putMsg(buf49)                                             .. show the item
  1340.     moveCursor(buf54,eFile)              .. put item at end of index building
  1341.     insertRgn(buf54,eFile,buf49,all)
  1342.     insertRgn(buf54,eFile,"  ",all)        .. space before page #s that go in
  1343.     insertChar(buf54,eLine)
  1344.     moveCursor(buf54,sChar)
  1345.     equateNum(n53,0)                                 .. so know if need comma
  1346.     moveCursor(curFile,sFile)
  1347.     label(2)
  1348.     setSearch(buf49)
  1349.     while (search(curFile,sInvert,eInvert,1)) {
  1350.         moveCursor(curFile,sChar)
  1351.         if (is(curFile,alpha)) {
  1352.             label(3)                       .. part of a bigger word so ignore
  1353.             moveCursor(curFile,eInvert)
  1354.             goto label(2)                                 .. and resume search
  1355.         }
  1356.         if (is(curFile,digit)) goto label(3)   .. part of bigger word, ignore
  1357.         moveCursor(curFile,eInvert)
  1358.         if (is(curFile,alpha)
  1359.              | is(curFile,digit)) goto label(2).. part of bigger word, ignore
  1360.         getPageRowCol(n54,n50,n49)                       .. this uses display
  1361.         moveCursor(curFile,eForm)           .. don't search again on this page
  1362.         if (!eqNum(n53,0)) insertChar(buf54,",")    .. put comma if not 1st #
  1363.         toWord(buf54,n54)               .. install the page # after index item
  1364.         equateNum(n53,n54)         .. so will put in comma next time for sure
  1365.     }
  1366.     goto label(1)                                  .. get next item from buf41
  1367. >
  1368.  
  1369. Toggle the "make icons" flag.  When "on", Workbench icons are created
  1370. <altCtl-i: flipFlag(curFile,icons)>
  1371.  
  1372. Enter idle-timer value (tenths of sec) after which idle command executed
  1373. <shftAltCtl-i:
  1374.     putMsg("Input idle time (tenths of a second)")
  1375.     if (inputNum(n54)) equateNum(idleTime,n54)>
  1376.  
  1377. Toggle the right-justify typing mode
  1378. <alt-j: flipFlag(curFile,rightJustify) >
  1379.  
  1380. Join next line to cursor line
  1381. <ctl-j:
  1382.     if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  1383.     clearChar(curFile)
  1384.     while (is(curFile,space) | is(curFile,9)) clearChar(curFile)
  1385.     insertChar(curFile," ") >
  1386.  
  1387. Move the hilite to the left by one character (space or tab)
  1388. <alt-l:
  1389.     moveCursor(curFile,sHilite)
  1390.     if (!is(curFile,sLine)) moveCursor(curFile,sLine)
  1391. label(1)
  1392.     if (is(curFile,space) | is(curFile,9)) clearChar(curFile)
  1393.     if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  1394.     moveCursor(curFile,eChar)                            .. start of next line
  1395.     if (gtLoc(curFile,eHilite,atCursor)) goto label(1) >
  1396.  
  1397. Convert the character under the cursor to lower case and move cursor fwd
  1398. <ctl-l:
  1399.     toLower(curFile)
  1400.     moveCursor(curFile,eChar) >
  1401.  
  1402. Set bottom margin
  1403. <lAmiga-l:
  1404.     putMsg("Input bottom margin lines (0-200):")
  1405.     if (inputNum(n54)) equateNum(bottomMargin,n54)
  1406.     setLocal(curFile,bottomMargin,bottomMargin)>
  1407.  
  1408. Set command multiplier to use for next command
  1409. <ctl-m: putMsg("Input command multiplier:") inputNum(cmdMultiplier) >
  1410.  
  1411. Swap the mouse's button-Up operation with the next key-command pressed
  1412. <alt-m:
  1413.     putMsg("Will swap mouse buttonUp with your next input:")
  1414.     getKey(n53)
  1415.     if (swapKey(n53,normal-buttonUp)) {
  1416.         putMsg("Swapped - to undo, do it again")
  1417.         return
  1418.     }
  1419.     putMsg(" ") >
  1420.  
  1421. Map illegal ASCII (0 thru 5) characters into safe ones.  (See top of Config!)
  1422. <shftAlt-m: flipFlag(curFile,mapChars)>
  1423.  
  1424. Rename the document in the window
  1425. <alt-n:
  1426.     putMsg("Input new filename:")
  1427.     getFileName(buf43,curFile)
  1428.     if (inputString(buf43))
  1429.     setFileName(curFile,buf43) >
  1430.  
  1431. Input a text line number to go to
  1432. <ctl-n:
  1433.     putMsg("Input line number:")
  1434.     if (inputNum(n54)) {
  1435.         lineToLoc(curFile,atCursor,n54)
  1436.         vScroll(atCursor)
  1437.     } >
  1438.  
  1439. Open the cursor line for typing
  1440. <ctl-o:
  1441.     insertChar(curFile,eLine)
  1442.     moveCursor(curFile,sChar) >
  1443.  
  1444. Move the hilite region to the right by one space
  1445. <alt-r:
  1446.     moveCursor(curFile,sHilite)
  1447.     if (!is(curFile,sLine)) moveCursor(curFile,sLine)
  1448.     while (gtLoc(curFile,eHilite,atCursor)) {
  1449.         insertChar(curFile,32)
  1450.         if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  1451.         moveCursor(curFile,eChar)
  1452.     } >
  1453.  
  1454. Terminate Learn Mode or run whatever is stored in learn-buffer.  (See ctl-s.)
  1455. <ctl-r: runLearn  >
  1456.  
  1457. Speak the hilite region
  1458. <alt-s:
  1459.     if (gtLoc(curFile,eHilite,sHilite)) {
  1460.         freeBuf(buf50)
  1461.         insertRgn(buf50,eFile,curFile,hilite)
  1462.         speak(buf50)
  1463.     } >
  1464.  
  1465. Start/abort Learn Mode.  (Use ctl-r to finish & to run it.)
  1466. <ctl-s:
  1467.     if (!getFlag(curFile,learnMode)) putMsg("LEARN MODE ACTIVE!")
  1468.     else putMsg("Learn Mode cancelled.")
  1469.     flipFlag(curFile,learnMode) >
  1470.  
  1471. Line sort:  sorts stacked list of words/phrases (removes duplicates).
  1472. <shftAlt-s:
  1473.     movecursor(curfile,sfile)
  1474.     refreshdisplay
  1475.     runKey(lAmiga-t)                                .. convert tabs to spaces
  1476.     putMsg("Del trail white...")
  1477.     runKey(ctl-4)                                .. clear trailing white space
  1478.     moveCursor(curfile,sfile)
  1479.     putMsg("Del blank lines...")
  1480. label(0)
  1481.     if (is(curfile,eline)) clearChar(curfile)
  1482.     else moveCursor(curfile,downLine)
  1483.     if (not is(curfile,efile)) goto label(0)
  1484.     movecursor(curfile,sfile)
  1485.     refreshdisplay
  1486.  
  1487.     putMsg("Sorting")
  1488.     .. count lines
  1489.     movecursor(curfile,sfile)
  1490.     equateNum(n54,0)
  1491.     while (moveCursor(curfile,downline)) incNum(n54)
  1492.     if (gtNum(2,n54)) returnFalse                           .. too few to sort
  1493.     equateNum(n53,n54)      .. store MAX
  1494.  
  1495.     while (nothing) {     .. while (gap >>= 1)
  1496.         div(n54,n54,2)
  1497.         if (eqNum(n54,0)) {
  1498.             moveCursor(curfile,sfile)
  1499.             refreshdisplay
  1500.             putMsg("Done")
  1501.             return
  1502.         }
  1503. label(20)
  1504.         equateNum(n50,0)    .. swapped = FALSE
  1505.         putMsg(n54) .. show gap size
  1506.         fileSize(curfile,n0)
  1507.  
  1508.         moveCursor(curfile,sfile)    .. cursor at start of file
  1509.         refreshdisplay
  1510.         swapLoc(curfile,atcursor,loca)
  1511.         moveCursor(curfile,sfile)
  1512.         equateNum(n51,n54)  .. put locA 1 gap distance from sof
  1513.         while (decNum(n51)) moveCursor(curfile,downline)
  1514.         swapLoc(curfile,atCursor,loca)  .. now ready
  1515.  
  1516.         while (nothing) {
  1517.             clearRgn(buf48,all)
  1518.             clearRgn(buf49,all)
  1519.             insertRgn(buf48,efile,curfile,line) .. copy cursor line
  1520.             swapLoc(curfile,atcursor,loca)
  1521.             insertRgn(buf49,efile,curfile,line) .. copy locA line
  1522.             swapLoc(curfile,atcursor,loca)
  1523.             if (isEmpty(buf49) | isEmpty(buf48)) goto label(21)
  1524.             if (stringComp(n49,buf49,buf48,1)) { .. delete duplicate
  1525.                 if (stringComp(n49,buf49,buf48,0)) { .. true dup?
  1526.                     clearRgn(curfile,line)
  1527.                     clearChar(curfile)
  1528.                     equateNum(n50,1) .. swapped = TRUE, force a rerun
  1529.                     moveCursor(curfile,sline)
  1530.                     putMsg(buf48)
  1531.                 }
  1532.             } else if (gtNum(0,n49)) {  .. not alpha order, swap them
  1533.                 clearRgn(curfile,line)
  1534.                 insertRgn(curfile,atcursor,buf49,all)
  1535.                 moveCursor(curfile,sLine)    .. start of this line
  1536.                 swapLoc(curfile,atcursor,loca)
  1537.                 clearRgn(curfile,line)
  1538.                 insertRgn(curfile,atcursor,buf48,all)
  1539.                 moveCursor(curfile,sLine)    .. start of this line
  1540.                 swapLoc(curfile,atcursor,loca)
  1541.                 equateNum(n50,1) .. swapped = TRUE
  1542.                 putMsg(buf48)
  1543.             }
  1544.             moveCursor(curfile,eLine)
  1545.             moveCursor(curfile,eChar)
  1546.             swapLoc(curfile,atcursor,loca)
  1547.             moveCursor(curfile,eLine)
  1548.             moveCursor(curfile,eChar)
  1549.             swapLoc(curfile,atcursor,loca)
  1550.         }
  1551. label(21)
  1552.         if (eqNum(n50,1)) goto label(20) .. got swaps, go again
  1553.     }
  1554.  
  1555. >
  1556.  
  1557. Show key-help message on next key pressed.  Copy key-help to RAM: on first
  1558. <ctl-t:
  1559.     putMsg("Input a key, gadget, click etc to get Help msg")
  1560.     getKey(n54)
  1561.     teachOne(n54)>
  1562.  
  1563. Toggle between using printable keys for commands or for normal typing input
  1564. <alt-u: flipFlag(curFile,useKeys)>
  1565.  
  1566. Load UStar config
  1567. <virtual-u:
  1568.     if (!loadConfig("UstarData!")) loadConfig("S:UstarData!") >
  1569.  
  1570. Convert char under cursor to upper case
  1571. <ctl-u:
  1572.     toUpper(curFile)
  1573.     moveCursor(curFile,eChar) >
  1574.  
  1575. Set left margin
  1576. <lAmiga-m:
  1577.     putMsg("Input left margin column (0-200):")
  1578.     if (inputNum(n54)) equateNum(leftMargin,n54)
  1579.     setLocal(curFile,leftMargin,leftMargin)>
  1580.  
  1581. Set top margin
  1582. <lAmiga-u:
  1583.     putMsg("Input top margin lines (0-200):")
  1584.     if (inputNum(n54)) equateNum(topMargin,n54)
  1585.     setLocal(curFile,topMargin,topMargin)>
  1586.  
  1587. Switch flag that makes CTRL chars vis/invis
  1588. <ctl-v: flipFlag(curFile,spooks) refreshDisplay >
  1589.  
  1590. Swap the current document in window with buffer 41
  1591. <ctl-w: swapBuf(curFile,buf41) >
  1592.  
  1593. Swap current buffer to buffer 0 (the "home" buffer of Uedit)
  1594. <alt-w:
  1595.     swapBuf(buf0,curFile)
  1596.     editBuf(buf0) >
  1597.  
  1598. For programmers:  Toggle number under cursor between hex/decimal
  1599. <ctl-x: hexDecimal(curFile) >
  1600.  
  1601. Execute an AmigaDOS command, but don't collect the results
  1602. <ctl-y:
  1603.     putMsg("Enter AmigaDOS command")
  1604.     freeBuf(buf40)
  1605.     if (inputString(buf40)) execute(" ",buf40) >
  1606.  
  1607. Execute an AmigaDOS command and show the results
  1608. <ctl-z:
  1609.     putMsg("Enter AmigaDOS command")
  1610.     freeBuf(buf40)
  1611.     freeBuf(buf39)
  1612.     if (!inputString(buf40) | !execute(buf39,buf40)) returnFalse
  1613.     if (!isEmpty(buf39)) {
  1614.         putMsg("Result of AmigaDOS command:")
  1615.         downFlag(buf39,changed)
  1616.         editBuf(buf39)
  1617.         vscroll(sFile)
  1618.         updateDisplay
  1619.         return
  1620.     }
  1621.     putMsg("No reply from AmigaDOS.")
  1622.     freeBuf(buf39) >
  1623.  
  1624. Search for buf53 dirname in buf38.  Add name to list if not there.
  1625. <virtual-7:
  1626.     moveCursor(buf53,eFile)
  1627.     decLoc(buf53,atCursor)
  1628.     if (!is(buf53,"/") & !is(buf53,":")) insertRgn(buf53,eFile,"/",all)
  1629.     if (isEmpty(buf38)) runKey(virtual-8)                 .. default dir names
  1630.                                          .. if (isEmpty(buf38)) goto label(0)
  1631.     moveCursor(buf38,sFile)
  1632.     equateLoc(buf38,eHilite,sHilite)
  1633. label(1)
  1634.     while (is(buf38,whiteSpace)) moveCursor(buf38,eChar)
  1635.     if (is(buf38,eFile)) goto label(0)                              .. add it
  1636.     equateLoc(buf38,sHilite,atCursor)                           .. store start
  1637.     while (!is(buf38,whiteSpace) & !is(buf38,eFile))
  1638.         moveCursor(buf38,eChar)
  1639.     equateLoc(buf38,eHilite,atCursor)                             .. store end
  1640.     freeBuf(buf52)
  1641.     insertRgn(buf52,sFile,buf38,hilite)
  1642.     if (!stringComp(n54,buf53,buf52,1)) goto label(1)             .. try again
  1643.     moveCursor(buf38,sHilite)           .. found dirname.  Put cursor at start
  1644.     goto label(5)
  1645. label(0)                                        .. dirname not found.  Add it
  1646.     moveCursor(buf38,eFile)
  1647.     if (!isEmpty(buf53)) {
  1648.         locToCol(buf38,n54,atCursor)
  1649.         if (gtNum(n54,60)) insertChar(buf38,eLine)
  1650.         else insertChar(buf38,9)                                       .. tab
  1651.     }
  1652.     equateLoc(buf38,sHilite,eFile)
  1653.     decLoc(buf38,sHilite)
  1654.     insertRgn(buf38,eFile,buf53,all)         .. install new dirname as curdir
  1655.     equateLoc(buf38,eHilite,eFile)
  1656.     incLoc(buf38,sHilite)
  1657.     moveCursor(buf38,sHilite)
  1658.     equateNum(n54,curFile)
  1659. label(5)
  1660.     freeBuf(buf53)
  1661.     if (!eqNum(n54,38) & gotoSplit(buf38)) gotoSplit(buf[n54])..force refresh
  1662.     runKey(virtual-9)
  1663. >
  1664.  
  1665. Load beginning directory names into buf38
  1666. <virtual-8:
  1667.     if (isEmpty(buf38)) {
  1668.         if (!insertFile(buf38,eFile,"S:Directories"))
  1669.            insertRgn(buf38,eFile," DF0:    DF1:    DH0:    S:    RAM:    VD0:",all)
  1670.         moveCursor(buf38,eFile)
  1671.         equateLoc(buf38,sHilite,eHilite)
  1672.         equateLoc(buf38,mouseLoc,eFile)
  1673.      }
  1674.      equateLoc(buf38,sPage,sFile) >
  1675.  
  1676. Put up msg telling what click-loading directory now is.
  1677. <virtual-9:
  1678.     freeBuf(buf53)
  1679.     insertRgn(buf53,eFile,"Click-loading directory = ",all)
  1680.     if (gtLoc(buf38,eHilite,sHilite)) insertRgn(buf53,eFile,buf38,hilite)
  1681.     else insertRgn(buf53,eFile,"default",all)
  1682.     putMsg(buf53)
  1683.     freebuf(buf53) >
  1684.  
  1685. Get listing. (Also sets directoryname used in ctl-buttonDown.)
  1686. <alt-z:
  1687.     putMsg("Enter directory: ")
  1688.     freeBuf(buf53)
  1689.     if (inputString(buf53)) runKey(virtual-7)
  1690.     freeBuf(buf54)
  1691.     insertRgn(buf54,eFile,"Dir ",all)
  1692.     insertRgn(buf54,eFile,buf38,hilite)
  1693.     if (!execute(buf39,buf54)) returnFalse
  1694.     moveCursor(buf39,sFile)
  1695.     insertChar(buf39,eLine)
  1696.     insertRgn(buf39,sFile,buf38,hilite)
  1697.     newFile
  1698.     swapBuf(buf39,curFile)
  1699.     freeBuf(buf39)
  1700.     vScroll(sFile)
  1701.     putMsg("To load files, ctrl-click names with mouse.")
  1702.     setFileName(curFile,buf54)
  1703.     flipFlag(curFile,changed) >
  1704.  
  1705. Change the current working directory
  1706. <altCtl-z:
  1707.     putMsg("Change current directory to (may not work in Workbench):")
  1708.     freeBuf(buf53)
  1709.     if (inputString(buf53)) changeDir(buf53) >
  1710.  
  1711. Clear leading white space in cursor line
  1712. <alt-1:
  1713.     equateLoc(curFile,locA,atCursor)
  1714.     if (!is(curFile,sLine)) moveCursor(curFile,sLine)
  1715.     while (is(curFile,whiteSpace) & !is(curFile,eLine) & !is(curFile,12))
  1716.                 clearChar(curFile)
  1717.     equateLoc(curFile,atCursor,locA) >
  1718.  
  1719. Center text in the line.  (Uses current line length.)
  1720. <alt-2:
  1721.     runKey(alt-1)                                 .. clear leading white space
  1722.     if (is(curFile,blankLine)) returnFalse
  1723.     if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  1724.     locToCol(curFile,n53,atCursor)
  1725.     getLocal(curFile,n54,lineLength)
  1726.     if (gtNum(n54,n53)) {
  1727.         moveCursor(curFile,sLine)
  1728.         incNum(n54)
  1729.         sub(n53,n54,n53)
  1730.         div(n53,n53,2)
  1731.         do (n54,1,n53) insertChar(curFile," ")
  1732.     } >
  1733.  
  1734. Match indent of cursor line to previous line
  1735. <alt-4:
  1736.     equateNum(n54,0)
  1737.     moveCursor(curFile,upLine)
  1738.     if (!getFlag(curFile,autoIndent)) {
  1739.         flipFlag(curFile,autoIndent)
  1740.         equateNum(n54,1)
  1741.     }
  1742.     if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  1743.     clearChar(curFile)
  1744.     typeChar(eLine)
  1745.     if (eqNum(n54,1)) flipFlag(curFile,autoIndent)
  1746.     moveCursor(curFile,downLine) >
  1747.  
  1748. Right-align the cursor line from cursor rightward
  1749. <alt-5:
  1750.     if (!is(curFile,whiteSpace)) moveCursor(curFile,sChar)
  1751.     if (is(curFile,eLine)) return
  1752.     while (is(curFile,whiteSpace) & !is(curFile,sLine)) {
  1753.         clearChar(curFile)
  1754.         moveCursor(curFile,sChar)
  1755.     }
  1756.     moveCursor(curFile,eChar)
  1757.     equateLoc(curFile,locA,atCursor)
  1758.     if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  1759.     locToCol(curFile,n54,atCursor)
  1760.     decNum(n54)
  1761.     getLocal(curFile,n53,lineLength)
  1762.     sub(n54,n53,n54)
  1763.     moveCursor(curFile,locA)
  1764.     if (gtNum(n54,0)) while (decNum(n54)) insertChar(curFile," ") >
  1765.  
  1766. Show the value of a number variable
  1767. <alt-8:
  1768.     putMsg("n-variable #: ")
  1769.     inputNum(n54)
  1770.     freeBuf(buf54)
  1771.     insertChar(buf54,"n")
  1772.     toWord(buf54,n54)
  1773.     insertRgn(buf54,eFile," is ",all)
  1774.     toWord(buf54,n[n54])
  1775.     putMsg(buf54) >
  1776.  
  1777. Set the value of a number variable
  1778. <alt-9:
  1779.     putMsg("Set n-variable #:")
  1780.     inputNum(n54)
  1781.     putMsg("To value:")
  1782.     inputNum(n[n54])>
  1783.  
  1784. Show the ASCII value of the character under the cursor
  1785. <ctl-/:
  1786.     copyChar(curFile,n54)
  1787.     freeBuf(buf54)
  1788.     toWord(buf54,n54)
  1789.     insertRgn(buf54,sFile,"Character value under cursor was ",all)
  1790.     putMsg(buf54)
  1791.     moveCursor(curFile,eChar) >
  1792.  
  1793. Show the current document size
  1794. <ctl-1:
  1795.     fileSize(curFile,n54)
  1796.     freeBuf(buf54)
  1797.     insertRgn(buf54,sFile,"File size in bytes: ",all)
  1798.     toWord(buf54,n54)
  1799.     putMsg(buf54)>
  1800.  
  1801. Switch displaying of cursor row-column off/on
  1802. <ctl-2: flipFlag(curFile,rowCol) >
  1803.  
  1804. This is a simple reformat cmd that doesn't refmt indented paragraphs.
  1805. .. <ctl-3: if (reformat) moveCursor(curFile,downLine) >
  1806.  
  1807. Reformat cursor paragraph, starting at cursor line
  1808. <ctl-3:                   .. move down, if blank line, to find par beginning.
  1809.     while (is(curFile,blankLine)) {
  1810.         moveCursor(curFile,downLine)
  1811.         if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  1812.         if (is(curFile,eFile)) returnFalse
  1813.     }
  1814.     equateNum(n3,0)                                      .. a flag used below
  1815.     equateLoc(curFile,locA,atCursor)                   .. store par beginning
  1816. label(2)                                        .. get indent of 1st par line
  1817.     if (!is(curFile,sLine)) moveCursor(curFile,sLine)
  1818.     while (is(curFile,whiteSpace)) moveCursor(curFile,eChar)
  1819.     locToCol(curFile,n0,atCursor)                 .. get the 1st line's indent
  1820.  
  1821.     if (eqNum(n3,0)) {                                 .. if doing FIRST line
  1822.         equateNum(n1,n0)                      .. store indent of 1st par line
  1823.         equateNum(n3,1)                 .. set a flag so won't come back here
  1824.         equateLoc(curFile,locB,atCursor)           .. store 1st text location
  1825.         moveCursor(curFile,downLine)                      .. move to 2nd line
  1826.         if (is(curFile,blankLine)) {                        .. no second line
  1827.             equateNum(n0,1)
  1828.             goto label(3)
  1829.         }
  1830.         goto label(2)                .. go back and get indent of 2nd par line
  1831.     }
  1832. label(3)
  1833.     moveCursor(curFile,upLine)                       .. move back to 1st line
  1834.     equateNum(n2,n0)                              .. store indent of 2nd line
  1835.  
  1836.     if (eqNum(n2,-1) | geNum(n2,n1)) {                  .. was no 2nd line or
  1837.         reformat                       .. 2nd line inset, so do only 1st line
  1838.         goto label(5)                                              .. finished
  1839.     } else {                             .. 2nd line has less or equal indent
  1840.         sub(n1,n1,n2)                     .. par indent = 1st indent minus 2nd
  1841.         colToLoc(curFile,atCursor,n2)
  1842.         equateLoc(curFile,locA,atCursor)
  1843.         clearRgn(curFile,loc)              .. wiping out extra 1st line indent
  1844.         do (n54,1,n1) insertChar(curFile,"x")                 .. repl with x's
  1845.         moveCursor(curFile,sWord)                          .. made a FAKE WORD
  1846.         equateLoc(curFile,locA,atCursor)                     .. store its loc
  1847.         reformat                              .. now paragrah has SAME indent
  1848.         equateLoc(curFile,locB,atCursor)                  .. store end of par
  1849.         moveCursor(curFile,locA)                      .. go back to fake word
  1850.         while (is(curFile,"x")) {                       .. swap x's for spaces
  1851.             swapChar(curFile," ")
  1852.             moveCursor(curFile,eChar)
  1853.         }                                             .. now fake word is gone
  1854.         equateLoc(curFile,atCursor,locB)                   .. goto end of par
  1855. label(5)
  1856.         moveCursor(curFile,downLine)                       .. leave paragraph
  1857.     }
  1858. >
  1859.  
  1860. Delete all trailing white-space in current document
  1861. <ctl-4:
  1862.     equateLoc(curFile,locA,atCursor)
  1863.     moveCursor(curFile,sFile)
  1864.     while (nothing) {
  1865.         if (is(curFile,eFile))
  1866.             { equateLoc(curFile,atCursor,locA) return }
  1867.         moveCursor(curFile,eLine)
  1868.         moveCursor(curFile,sChar)
  1869.         while (is(curFile,space) | is(curFile,9))
  1870.             { clearChar(curFile) moveCursor(curFile,sChar) }
  1871.         moveCursor(curFile,eLine)
  1872.     } >
  1873.  
  1874. Save a learn-sequence to disk, saving it under a Name
  1875. <ctl-5:
  1876.     putMsg("Save learn seq under what Name?")
  1877.     freeBuf(buf54)
  1878.     if (inputString(buf54) & !saveLearn(buf54))
  1879.                 putMsg("Couldn't save") >
  1880.  
  1881. Load a learn-sequence stored on disk
  1882. <ctl-6:
  1883.     putMsg("Load what learn seq Name?")
  1884.     freeBuf(buf54)
  1885.     if (inputString(buf54) & !loadLearn(buf54))
  1886.                 putMsg("Not found") >
  1887.  
  1888. Load and run learn-sequence stored on disk
  1889. <ctl-7:
  1890.     putMsg("Load & run what learn seq Name?")
  1891.     freeBuf(buf54)
  1892.     if (inputString(buf54) & loadLearn(buf54)) runLearn
  1893.     else putMsg("Not found") >
  1894.  
  1895. Toggle case-sensitivity of search
  1896. <ctl-8: flipFlag(curFile,searchCaps) >
  1897.  
  1898.                         *** arithmetic commands ***
  1899.  
  1900. Set running arithmetic total to zero
  1901. <ctl-0: equateNum(n49,0) >
  1902.  
  1903. Type the running arithmetic total into text at cursor
  1904. <ctl-\:
  1905.     freeBuf(buf54)
  1906.     div(n52,n49,100)
  1907.     if (gtNum(0,n49)) if (eqNum(n52,0)) insertChar(buf54,"-")
  1908.     toWord(buf54,n52)
  1909.     insertChar(buf54,".")
  1910.     if (gtNum(0,n49)) mul(n52,n49,-1)
  1911.     else equateNum(n52,n49)
  1912.     mod(n52,n52,100)
  1913.     if (gtNum(10,n52)) insertChar(buf54,"0")
  1914.     toWord(buf54,n52)
  1915.     insertRgn(curFile,atCursor,buf54,all)
  1916.     insertRgn(buf54,sFile,"Inserted total into text ",all)
  1917.     putMsg(buf54) >
  1918.  
  1919. Add the next word (if a number) to arithmetic total & display total
  1920. <ctl-=:
  1921.     moveCursor(curFile,eWord)
  1922.     moveCursor(curFile,sWord)
  1923.     if (!is(curFile,digit)) returnFalse
  1924.     toNumber(n54,curFile)
  1925.     moveCursor(curFile,eWord)
  1926.     if (is(curFile,".")) {
  1927.         moveCursor(curFile,eChar)
  1928.         if (!is(curFile,digit)) goto label(1)
  1929.         toNumber(n53,curFile)
  1930.         moveCursor(curFile,eChar)
  1931.         if (!is(curFile,digit)) {
  1932.             mul(n53,n53,10)
  1933.             moveCursor(curFile,sChar)
  1934.         }
  1935.         moveCursor(curFile,eWord)
  1936.     } else { label(1) equateNum(n53,0) }
  1937.     mul(n54,n54,100)
  1938.     if (gtNum(0,n54)) mul(n52,n53,-1)
  1939.     else equateNum(n52,n53)
  1940.     add(n54,n54,n52)
  1941.     add(n49,n49,n54)
  1942.     freeBuf(buf54)
  1943.     div(n52,n49,100)
  1944.     if (gtNum(0,n49) & eqNum(n52,0)) insertChar(buf54,"-")
  1945.     toWord(buf54,n52)
  1946.     insertChar(buf54,".")
  1947.     mod(n52,n49,100)
  1948.     if (gtNum(0,n49)) mul(n52,-1,n52)
  1949.     if (gtNum(10,n52)) insertChar(buf54,"0")
  1950.     toWord(buf54,n52)
  1951.     insertRgn(buf54,sFile,"Running total is ",all)
  1952.     putMsg(buf54) >
  1953.  
  1954. Subtract the next word (if a number) from arithmetic total & display total
  1955. <ctl--:
  1956.     moveCursor(curFile,eWord)
  1957.     moveCursor(curFile,sWord)
  1958.     if (!is(curFile,digit)) returnFalse
  1959.     toNumber(n54,curFile)
  1960.     moveCursor(curFile,eWord)
  1961.     if (is(curFile,".")) {
  1962.         moveCursor(curFile,eChar)
  1963.         if (!is(curFile,digit)) goto label(1)
  1964.         toNumber(n53,curFile)
  1965.         moveCursor(curFile,eChar)
  1966.         if (!is(curFile,digit)) {
  1967.             mul(n53,n53,10)
  1968.             moveCursor(curFile,sChar)
  1969.         }
  1970.         moveCursor(curFile,eWord)
  1971.     } else {
  1972. label(1)
  1973.         equateNum(n53,0)
  1974.     }
  1975.     mul(n54,n54,100)
  1976.     if (gtNum(0,n54)) mul(n52,n53,-1)
  1977.     else equateNum(n52,n53)
  1978.     add(n54,n54,n52)
  1979.     sub(n49,n49,n54)
  1980.     freeBuf(buf54)
  1981.     div(n52,n49,100)
  1982.     if (gtNum(0,n49) & eqNum(n52,0)) insertChar(buf54,"-")
  1983.     if (gtNum(0,n49)) insertChar(buf54,"-")
  1984.     toWord(buf54,n52)
  1985.     insertChar(buf54,".")
  1986.     mod(n52,n49,100)
  1987.     if (gtNum(0,n52)) mul(n52,n52,-1)
  1988.     if (gtNum(10,n52)) insertChar(buf54,"0")
  1989.     toWord(buf54,n52)
  1990.     insertRgn(buf54,sFile,"Running total is ",all)
  1991.     putMsg(buf54) >
  1992.  
  1993.                            *** columnar data ***
  1994.  
  1995. Put up msg saying turn ON columnar if it is OFF.
  1996. <virtual-`:
  1997.     if (!getFlag(curFile,columnar)) {
  1998.         alertUser("Turn ON columnar display mode first.  (See Columnar menu.)")
  1999.         abort
  2000.     } >
  2001.  
  2002. Toggle between columnar display and regular hilite/invert display mode
  2003. <shftCtl-`:
  2004.     flipFlag(curFile,columnar)
  2005.     refreshDisplay >
  2006.  
  2007. Copy and then clear the hilited columnar data
  2008. <shftCtl-1:
  2009.     runKey(virtual-`)
  2010.     freeBuf(buf37)
  2011.     copyColData(buf37,sFile,curFile,hilite,1)
  2012.     clearColData(curFile,hilite,0)  >
  2013.  
  2014. Space-fill the hilited columnar data, overlaying the original text.  No copy
  2015. <shftCtl-2:
  2016.     runKey(virtual-`)
  2017.     clearColData(curFile,hilite,1) >
  2018.  
  2019. Copy the hilited columnar data into a buffer
  2020. <shftCtl-3:
  2021.     runKey(virtual-`)
  2022.     if (geLoc(curFile,sHilite,eHilite)) returnFalse
  2023.     freeBuf(buf37) copyColData(buf37,sFile,curFile,hilite,1)>
  2024.  
  2025. Insert copied columnar data at the cursor
  2026. <shftCtl-4:
  2027.     runKey(virtual-`)
  2028.     copyColData(curFile,atCursor,buf37,all,1)>
  2029.  
  2030. Overlay copied columnar data onto existing text at the cursor
  2031. <shftCtl-5:
  2032.     runKey(virtual-`)
  2033.     copyColData(curFile,atCursor,buf37,all,0)>
  2034.  
  2035. Insert the columnar hilite region at the cursor.  (No intermediate copy.)
  2036. <shftCtl-6:
  2037.     runKey(virtual-`)
  2038.     copyColData(curFile,atCursor,curFile,hilite,1)>
  2039.  
  2040. Overlay the columnar hilite region onto existing text at the cursor
  2041. <shftCtl-7:
  2042.     runKey(virtual-`)
  2043.     copyColData(curFile,atCursor,curFile,hilite,0)>
  2044.  
  2045.                           *** interlace mode ***
  2046.  
  2047. Switch to/from interlace display mode
  2048. <shft-esc: flipFlag(curFile,lace)>
  2049.  
  2050. Switch to regular screen, 1 bitplane
  2051. <rAmiga-f1: setLocal(curfile, lace, 1) >
  2052.  
  2053. Switch to regular screen, 2 bitplanes
  2054. <rAmiga-f2: setLocal(curfile, lace, 0) >
  2055.  
  2056. Switch to lace screen, 1 bitplane
  2057. <rAmiga-f3: setLocal(curfile, lace, 3) >
  2058.  
  2059. Switch to lace screen, 2 bitplanes
  2060. <rAmiga-f4: setLocal(curfile, lace, 2) >
  2061.  
  2062. Tune the RGB colors in interlace using mouse.  (See alt-Help also.)
  2063. <alt-esc: laceColor>
  2064.  
  2065. Toggle scroll type in range 0-2
  2066. <rAmiga-s:
  2067.     toggle(scrollType)
  2068.     putMsg(scrollType) >
  2069.  
  2070. Toggle hide-display off/on
  2071. <rAmiga-h:
  2072.     toggle(hideDisplay)
  2073.     putMsg(hideDisplay) >
  2074.  
  2075. Assign a name to one of the 4 gadgets (1-4)
  2076. <ctl-esc:
  2077.     putMsg("Enter gadget number (1-4):")
  2078.     if (!inputNum(n54) | gtNum(n54,4) | gtNum(1,n54)) returnFalse
  2079.     putMsg("Enter gadget name (one Space to clear):")
  2080.     freeBuf(buf54)
  2081.     inputString(buf54)
  2082.     if (!isEmpty(buf54)) {
  2083.         gadgetName(n54,buf54)
  2084.         putMsg(" ")
  2085.     } >
  2086.  
  2087. Uedit's About... msg
  2088. <shftAltCtl-a:
  2089.     updateDisplay
  2090.     getFilename(buf54,curfile)
  2091.     setFileName(curFile,"              About Uedit...")
  2092.     text(" ",0,0,0,-2)                       .. -2 clear screen using color 0
  2093.     text("UEDIT",3,36,7,0)
  2094.     text("(for AMIGA & PC)",4,30,0,0)
  2095.     text("(C) 1986-90 by Rick Stiles.   All rights reserved.",6,13,0,0)
  2096.     text("P.O. Box 666,",7,22,-1,0)
  2097.     text(" Washington, IN 47501",-1,-1,-1,0)
  2098.     text(" Uedit is a SHAREWARE programmable text editor for the",9,10,0,0)
  2099.     text(" technical user.  See Uedit-Tutorial for general info",10,10,-1,0)
  2100.     text(" and instructions.  Try Uedit and see how you like it.",11,10,-1,0)
  2101.     text(" If you USE it, become a REGISTERED USER by ordering",12,10,-1,0)
  2102.     text(" the unlimited version.   ",13,10,-1,0)
  2103.     text("    (See Uedit-Policy for price & registering info.)",15,10,0,0)
  2104.     getserialnum(n54)
  2105.     text("s/n ",16,33,7,0)
  2106.     text(n54,-1,-1,-1,0)
  2107.  
  2108.     do(n54,8,67) text(" ",1,n54,2,1)
  2109.     do(n54,2,17) text(" ",n54,67,-1,1)
  2110.     equateNum(n54,67)
  2111.     while (!eqNum(n54,8)) {
  2112.         text(" ",17,n54,-1,1)
  2113.         decNum(n54)
  2114.     }
  2115.     equateNum(n54,17)
  2116.     while (!eqNum(n54,1)) {
  2117.         text(" ",n54,8,-1,1)
  2118.         decNum(n54)
  2119.     }
  2120.     getKeyVal(n53,n53)
  2121.     setFileName(curFile,buf54)
  2122.     text(" ",0,0,0,-2)                        .. -2 clear screen in normalVid
  2123.     putmsg("  ")
  2124.     putmsg(" ")
  2125.     refreshDisplay >
  2126.  
  2127.                                    *****
  2128.  
  2129. Assign new Primitive Mode terminator Ctrl-key
  2130. <normal-esc:
  2131.     putMsg("Enter new Primitive Mode terminator CTRL-key (pmESC)")
  2132.     if (getChar(n54) & gtNum(32,n54)) equateNum(pmESC,n54)
  2133.     putMsg(" ") >
  2134.  
  2135. Save changed files during idle periods, if their idle-save flag is set
  2136. <idle:
  2137.     getMaxFiles(n52)
  2138.     decNum(n52)
  2139.     do (n54,0,n52) if (!inputWaiting & getflag(buf[n54],changed)
  2140.         & getflag(buf[n54],userLocalA)) saveFile(buf[n54]) >
  2141.  
  2142.                           *** end of Config!M ***
  2143.  
  2144.